<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
  var str1 = "Hollo"
  var str2 = "World"
  var str3 = "kobe"
  //字符串拼接
  //+
  var newString = str1+str2+str3
  console.log(newString)
  //concat方法：链式调用
   var newString2= str1.concat(str2).concat(str3)//链式来用
   var newString3 = str1.concat(str2,str3)
  console.log(newString2,newString3)


  //删除首尾的空格
  console.log("   why   ".trim())

  //字符串的切割
  var message = "abc - cba - mba - abc"
  var items = message.split("-")//按照-切割，切割的结果保存到数组中
   var newMessage = items.join("*")
   console.log(newMessage)
  console.log(items)
  </script>
</body>
</html>